package com.itheima.service.impl;

import com.itheima.domain.Student;
import com.itheima.mapper.StudentMapper;
import com.itheima.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper mapper;

    @Override
    public List<Student> findAll() {


        List<Student> studentList = mapper.findAll();
        return studentList;

    }

    @Override
    public void save(Student student) {

        mapper.save(student);

    }

    @Override
    public Student findById(String id) {

        Student student = mapper.findById(id);
        return student;

    }

    @Override
    public void update(Student student) {

        mapper.update(student);

    }

    @Override
    public void deleteById(String id) {

        mapper.deleteById(id);

    }
}
